<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
$api = app('Dingo\Api\Routing\Router');

$basePath = 'App\Http\Controllers\Api\V1\\';

$api->version('v1', function ($api) use ($basePath) {


    //广告
    $api->get('api/ad/list', $basePath.'AdController@adList');

    //商品
    $api->get('api/goods/list', $basePath.'GoodsController@goodsList');

    //上传商品图片
    $api->post('api/goods/upload_pic', $basePath.'GoodsController@storePic');

    //心愿
    $api->get('api/keys/list', $basePath.'KeywordsController@keysList');

    //上传心愿
    $api->post('api/keys/store', $basePath.'KeywordsController@store');

    //支付回调
    $api->any('api/payment/notify', $basePath.'PaymentController@notify');

    //查看祈福订单
    $api->get('api/order/list', $basePath.'OrderController@orderList');

    //查看祈福订单详情
    $api->get('api/order/info', $basePath.'OrderController@orderInfo');

    //需要认证的
    $api->group(['prefix' => 'api'], function ($api) use ($basePath) {
        //第三方登陆
        $api->post('user/third_login', $basePath.'UserController@thirdLogin');
        //用户信息
        $api->post('user/me', $basePath.'UserController@me');
        //订单
        $api->post('order/store', $basePath.'OrderController@store');
        //支付
        $api->post('payment/pay', $basePath.'PaymentController@pay');
        //点赞
        $api->post('order/nice', $basePath.'OrderController@addNice');
        //我得订单
        $api->get('user/order', $basePath.'UserController@order');
    });
});
